<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body onload="setInterval(gatDateTime,1000);">
		<div id="enclock"></div>
		<div id="cnclock"></div>
	</body>
	<script>
		function gatDateTime(){
			var date = new Date();
			
			var enclock = document.getElementById("enclock");
			enclock.innerHTML = "<font color='red'>" + date +"</font>"
			
			var cnclock = document.getElementById("cnclock");
			
			var year = date.getFullYear();
			var month = date.getMonth() + 1;
			var day = date.getDate();
			
			var hour = date.getHours();
			var minute = date.getMinutes();
			var second = date.getSeconds();
			
			cnclock.innerText = year+"年"+month+"月"+day+"日"+hour+"时"+minute+"分"+second+"秒";
		}
	</script>
</html>
